package design_pattern.builder.demo02;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @version 1.0.0
 * Created by cyd on 2022-06-15 14:54:25
 * @ClassName : design_pattern.builder.demo02.Director
 * @Description : 导演类，它机械的按顺序执行装配方法，但是并不在乎细节，细节在ConcreteBuilder里面
 */
@Data
@Accessors(chain = true)
public class Director {

    Builder builder;

    public Director(Builder builder) {
        this.builder = builder;
    }

    public Phone build() {
        builder.buildType();
        builder.installSoft();
        builder.testPhone();
        return builder.build();
    }
}
